package com.woniuxy.hotel.room.controller;/**
 * @Author ：Cheng Yl
 * @Date ：Created in 2019/8/6 20:47
 */

import com.woniuxy.hotel.room.pojo.RoomType;
import com.woniuxy.hotel.room.service.RoomTypeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName RoomType
 * @Author Cheng Yl
 * @Date 2019/8/6 20:47
 */
@Controller
@RequestMapping("/roomType")
public class RoomTypeController {
    @Resource
    RoomTypeService roomTypeService;
    
    @RequestMapping("/allRoomType")
    @ResponseBody
    public List<RoomType> allRoomType(){
        List<RoomType> list=roomTypeService.selectAllRoomType();
        System.out.println(list);
        return list;
    }
    
    @ResponseBody
    @RequestMapping("/selectPrice")
    public RoomType price(int typeId){
        return roomTypeService.selectPrice(typeId);
    }
}
